from mongoengine import *
from django.db import models
from django.contrib.auth.models import User 

class Profile(models.Model):
	"""
		An example Profile model that handles storing the oauth_token and
		oauth_secret in relation to a user. Adapt this if you have a current
		setup, there's really nothing special going on here.
	"""
	user = models.ForeignKey(User)
	oauth_token = models.CharField(max_length = 200)
	oauth_secret = models.CharField(max_length = 200)

class StringToLatLong(Document):
	string = StringField(required=True)
	latLong = GeoPointField(required=True)
	state = StringField(required=True)
	
	def __str__(self):
		return "%s in %s-> (%f,%f)" % (self.string, self.state, self.latLong[0], self.latLong[1])
		
class CompareResult(Document):
	term1 = StringField(required=True)
	term2 = StringField(required=True)
	days = ListField(FloatField())
	score = FloatField(required=True)